
package net.sahv.bdyz.service;

import java.util.List;

import net.sahv.bdyz.mapper.AddressMapper;
import net.sahv.bdyz.model.Address;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AddressService {

	@Autowired
	private AddressMapper addressMapper;

	public int insert(Address record) {
		return addressMapper.insert(record);
	}

	public List<Address> selectAll() {
		return addressMapper.selectAll();
	}

	public int delete(Integer id) {
		return addressMapper.deleteByPrimaryKey(id);
	}

	public Address findOne(Integer aId) {
		return addressMapper.selectByPrimaryKey(aId);
	}

	public int update(Address address) {
		return addressMapper.updateByPrimaryKey(address);
	}

	public List<Address> selectAllByMid(Integer mId) {
		return addressMapper.selectAllByMid(mId);
	}

	public Address finddefault(Integer mId) {
		return addressMapper.finddefault(mId);
	}

}
